package com.cangxuan.manage.dao;

import com.cangxuan.manage.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
/**
 * 用户DAO
 */
import java.util.List;
@Mapper
public interface IUserDao {
    List<User> select(@Param("pageIndex") int pageIndex,
                      @Param("pageSize") int pageSize,
                      @Param("id") int id,
                      @Param("mobile") String mobile,
                      @Param("realName") String realName,
                      @Param("idcard") String idcard,
                      @Param("realNameInfo") int realNameInfo
    );
    int selectCount(@Param("id") int id,
                    @Param("mobile") String mobile,
                    @Param("realName") String realName,
                    @Param("idcard") String idcard,
                    @Param("realNameInfo") int realNameInfo
    );


    int changeState(@Param("available") boolean available,
                    @Param("id") int id);
    @Update("update user set subscribe_to_the_sales_calendar=#{subscribeToTheSalesCalendar} where id=#{id}")
    int changeSubscribe(@Param("subscribeToTheSalesCalendar") boolean subscribeToTheSalesCalendar,
                    @Param("id") int id);
    @Update("update user set display_my_goods=#{displayMyGoods} where id=#{id}")
    int changeDisplayMyGoods(@Param("displayMyGoods") boolean displayMyGoods,
                    @Param("id") int id);
    @Update("update user set display_my_sell_goods=#{displayMySellGoods} where id=#{id}")
    int changeDisplayMySellGoods(@Param("displayMySellGoods") boolean displayMySellGoods,
                    @Param("id") int id);

    List<User> isRealNamed();
}
